package cn.wolfcode.luowowo.common.util;

import lombok.Getter;
import lombok.Setter;

/**
 * @author hslef
 */
@Getter
@Setter
public class AJaxResult {
    private boolean success;
    private String msg;
    private Object data;
    private int code;

    public AJaxResult() {
        this.success = true;
    }

    public AJaxResult(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public void mark(String msg){
        this.success = false;
        this.msg = msg;
    }

    public static AJaxResult SUCCESS(){
        return new AJaxResult();
    }

    public AJaxResult addData(Object data){
        this.data = data;
        return this;
    }

}
